#str_as_list.py
s = '123'
print(s.__len__())
print(s.index('2'))
print(s[0])

print('\nfor遍历\n')
for i in s:
    print(i,end = ' ')

print('\n下标遍历\n')

for i in range(0,len(s)):
    print(s[i],end = ' ')